package com.jboost.modules.app.service.strategry.hx;


import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.jboost.common.util.HttpRestUtils;
import com.jboost.common.util.JSONUtil;
import com.jboost.modules.app.constant.BaseResult;
import com.jboost.modules.app.service.strategry.common.AbstractJdy;
import com.jboost.modules.system.entity.FhdBom;
import com.jboost.modules.system.entity.HxMj;
import com.jboost.modules.system.entity.HxProduct;
import com.jboost.modules.system.mapper.HxMjMapper;
import com.jboost.modules.system.mapper.HxProductMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.http.HttpHeaders;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service(value = "HxMjQuery")
@Slf4j
public class HxMjQuery extends AbstractJdy<HxMj,HxMj, HxMjMapper, HxMj>  {


    public String getFormId() {
        return "641bd9f2a32dcd0009b8e462";
    }

    public HttpHeaders getJdyHeaders(){
        HttpHeaders jdyHeaders = new HttpHeaders();
        jdyHeaders.set("Authorization","Bearer "+ "smLHulipnrxt6Lx9x1GqA0CyzpSl4k2o");
        return jdyHeaders;
    }

    public String getAppId() {
        return "648413a12b740b0008c630a7";
    }

    @Scheduled(initialDelay = 1000, fixedRate = 3000000)
    public BaseResult<Boolean> invokeStrategy() throws Exception {
        HxMj hxProduct = new HxMj();
        sync(hxProduct);
        return BaseResult.success();
    }


}
